<template>
	<div class="print" id="div_print">
		<div class="print1" v-for="item in printInfo">
			<div class="printDetail">
				<p style="text-align: center;padding-top: 15px;margin-left: 190px">存酒卡</p>
				<p style="text-align: center;padding-top: 15px;margin-left: 190px">（NO:11111）</p>
				<p style="text-align: center;padding-top: 60px"><span>客人姓名:</span>{{item.KHXM}}</p>
				<p style="text-align: center;padding-top: 22.5px"><span>电&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp话:</span>{{item.Mobile}}</p>
				<p style="text-align: center;padding-top: 22.5px"><span>酒&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp类:</span>{{item.JL}}</p>
				<p style="text-align: center;padding-top: 22.5px"><span>数&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp量:</span>{{item.SL}}</p>
				<p style="text-align: center;padding-top: 22.5px"><span>存&nbsp&nbsp酒&nbsp&nbsp人:</span>{{item.CJR}}</p>
				<p style="text-align: center;padding-top: 60px;margin-left: 190px"><img src="../../assets/img/logo-bg.png"></p>
				<p style="text-align: center;font-size: 25px;margin-left: 190px">希古尚博</p>


			</div> 
		</div>
<!-- <div class="print1">
		<div class="printDetail">
			<p style="text-align: center;padding-top: 15px;margin-left: 190px">存酒卡</p>
			<p style="text-align: center;padding-top: 15px;margin-left: 190px">（NO:DEM000001）</p>
			<p style="text-align: center;padding-top: 60px"><span>客人姓名:</span>侯鹏</p>
			<p style="text-align: center;padding-top: 22.5px"><span>电&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp话:</span>18583946166</p>
			<p style="text-align: center;padding-top: 22.5px"><span>酒&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp类:</span>旺仔牛奶</p>
			<p style="text-align: center;padding-top: 22.5px"><span>数&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp量:</span>1</p>
			<p style="text-align: center;padding-top: 22.5px"><span>存&nbsp&nbsp酒&nbsp&nbsp人:</span>侯鹏</p>
			<p style="text-align: center;padding-top: 60px;margin-left: 190px"><img src="../../assets/img/logo-bg.png"></p>
			<p style="text-align: center;font-size: 25px;margin-left: 190px">希古尚博</p>
		

	</div> 
</div>
<div class="print1">
		<div class="printDetail">
			<p style="text-align: center;padding-top: 15px;margin-left: 190px">存酒卡</p>
			<p style="text-align: center;padding-top: 15px;margin-left: 190px">（NO:DEM000001）</p>
			<p style="text-align: center;padding-top: 60px"><span>客人姓名:</span>侯鹏</p>
			<p style="text-align: center;padding-top: 22.5px"><span>电&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp话:</span>18583946166</p>
			<p style="text-align: center;padding-top: 22.5px"><span>酒&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp类:</span>旺仔牛奶</p>
			<p style="text-align: center;padding-top: 22.5px"><span>数&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp量:</span>1</p>
			<p style="text-align: center;padding-top: 22.5px"><span>存&nbsp&nbsp酒&nbsp&nbsp人:</span>侯鹏</p>
			<p style="text-align: center;padding-top: 60px;margin-left: 190px"><img src="../../assets/img/logo-bg.png"></p>
			<p style="text-align: center;font-size: 25px;margin-left: 190px">希古尚博</p>
		

	</div> 
</div> -->
</div>
</template>
<style scoped>
	.print{
		width: 944px;
		margin: 0 auto
	}
	.print1{
		width: 944px;
		clear: both;
		height: 720px;
		margin: 0 auto;
		position: relative;
	}
	.printDetail{
		position: absolute;
		/*left: -100px;*/
		width: 944px;
		height: 472px;
		margin: 0 auto;
		font-size: 30px;
		clear: both;
		padding: 10px 50px;
		color: black;
		font-family: "微软雅黑";
		margin-top: 60px;
	}
	p{
		width: 400px;
		clear: both;
		overflow: hidden;
		margin:0 auto;
	}
	span{
		display: inline-block;float: left;
	}
</style>
<script>
	export default {
		data(){
			return{
				printInfo:[],
				
			}
		},
		created(){
			//获取打印数据
			this.printInfo = JSON.parse(sessionStorage.printInfo)
			console.log(this.printInfo)
			
		},
		mounted(){
			this.printdiv("div_print")
		},
		methods:{
			//打印功能
			printdiv:function(printpage){

				var headstr="<html><head><title></title></head><body>"; 
				var footstr="</body>"; 
				var newstr=document.all.item(printpage).innerHTML; 
				var oldstr=document.body.innerHTML; 
				document.body.innerHTML=headstr+newstr+footstr; 
				window.print();  
				document.body.innerHTML=oldstr; 
				return false; 
			}
		}
	}
</script>